<template>
	<view class="mainpadding2" v-if="pageShow">
		<view class="mainpadding_top ffffff radius">
			<view class="titletext hei_text bold">商品详情</view>
			<view class="flexleft margin_top"  v-for="(item,index) in dataAll.goods" :key="item.id">
				<image :src="item.image_text" class="listleftimg3 margin_right" mode=""></image>
				<view class="flexcolumnbet" style="height: 140rpx;width: 100%;">
					<view class="main_size xiaohei lianghang">{{item.title}}</view>
					<view class="flexbetween" style="width: 100%;">
						<view class="titletext xiaohuang bold">{{item.price}}</view>
						<view class="xiaohui main_size">*{{item.number}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff radius">
			<view class="flexbetween">
				<view class="main_size xiaohei bold">支付积分</view>
				<view class="main_size xiaohuang">{{dataAll.pay_price}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="main_size xiaohei bold">订单编号</view>
				<view class="main_size xiaohui">{{dataAll.order_no}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="main_size xiaohei bold">下单时间</view>
				<view class="main_size xiaohui">{{dataAll.createtime_text}}</view>
			</view>
			<view class="" v-if="dataAll.remarks">
				<view class="main_size xiaohei bold margin_top">备注</view>
				<view class="main_size xiaohui margin_top">{{dataAll.remarks}}</view>
			</view>
		</view>
		<view class="gudingdb mainpadding">
			<view class="bigbtn" @click="hexiao()">确认核销</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				dataAll:{},
				pageShow:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
		},
		methods: {
			getDetail(){
				httpRequest.request('/api/order/hxDetail', 'GET', {
					id: this.listid,
				}).then(res => {
					if(res.code==1){
						this.dataAll = res.data
						this.pageShow = true
					}else{
						httpRequest.toast(res.msg)
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			},
			hexiao(){
				httpRequest.request('/api/order/confirmHx', 'GET', {
					id: this.listid,
				}).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			}
		}
	}
</script>

<style>

</style>
